
#ifndef _BUS_DRV_IF_H
#define _BUS_DRV_IF_H

#include <windows.h>
#include <winioctl.h>

/* Bus driver type. used in ClientInfo key to detect which driver loaded the SmsGenDrv */
typedef enum
{
	BD_TYPE_SDIO_STELLAR = 0,
	BD_TYPE_SPI_STELLAR,
	BD_TYPE_HIF_STELLAR,
	BD_TYPE_USB_STELLAR,
	BD_TYPE_USB_STELLAR_RAM,
	BD_TYPE_SDIO_NOVA,
	BD_TYPE_SPI_NOVA,
	BD_TYPE_HIF_NOVA,
	BD_TYPE_USB_NOVA,
	BD_TYPE_SDIO_VEGA,
	BD_TYPE_SPI_VEGA,
	BD_TYPE_HIF_VEGA,
	BD_TYPE_USB_VEGA,
	BD_TYPE_NONE = 0xFFFFFFFF

} BD_TYPE_E;


// same as SMSHOSTLIB_DEVICE_MODES_E
typedef enum
{
	SIANO_APP_DVBT,
	SIANO_APP_DVBH,
	SIANO_APP_DAB_TDMB,
	SIANO_APP_DAB_TDMB_DABIP,
	SIANO_APP_DVBT_BDA,
	SIANO_APP_ISDBT,
	SIANO_APP_ISDBT_BDA,
	SIANO_APP_CMMB,
	SIANO_APP_RAW_TUNER,
	SIANO_APP_NONE = 0xFFFFFFFF

} SIANO_APP_TYPE_E;

/* Bus driver prefix */
#define SIANO_SDIO_PREFIX	TEXT("SDI")
#define SIANO_SPI_PREFIX	TEXT("SPI")
#define SIANO_HIF_PREFIX	TEXT("HIF")
#define SIANO_USB_PREFIX	TEXT("SMU")

#define SMS_GEN_DRIVER_REGISTRY_PATH TEXT("Drivers\\Siano\\SMS1180\\SmsGenDrv")

/* callback to be registered in SIANO_BD_IOCTL_REGISTER_READ_CB */
typedef void (*BD_ReadCBFunc) (DWORD hContext, void* pBuffer, UINT32 BufSize);

typedef struct BD_IOCTL_REGISTER_READ_PARAMS_S
{
	BD_ReadCBFunc	pBD_ReadCBFunc;
	DWORD			hContext;

} BD_IOCTL_REGISTER_READ_PARAMS_ST, *PBD_IOCTL_REGISTER_READ_PARAMS_ST;


typedef struct BD_IOCTL_DOWNLOAD_FW_S
{
	PVOID						buf;
	DWORD						size;
	SIANO_APP_TYPE_E			application;

} BD_IOCTL_DOWNLOAD_FW_ST, *PBD_IOCTL_DOWNLOAD_FW_ST;

/* IOCTLS */

#define SIANO_MAKE_IOCTL(index) \
      CTL_CODE(40000, 2048 + (index), METHOD_BUFFERED, FILE_ANY_ACCESS)

/* Description : register callback to be called after driver read buffer from the device */
/* input  : pointer to PBD_IOCTL_REGISTER_READ_PARAMS_ST structure */
/* output : none */
#define SIANO_BD_IOCTL_REGISTER_READ_CB					SIANO_MAKE_IOCTL(0)

/* Description : write FW buffer to the device */
/* input  : buffer holds the FW to be written */
/* output : none */
#define SIANO_BD_IOCTL_WRITE_FW_BUFF_TO_DEVICE			SIANO_MAKE_IOCTL(1)

/* Description : Prepare interface for FW download */
/* input  : none */
/* output : none */
#define SIANO_BD_IOCTL_PREPARE_FOR_FW_DNL   			SIANO_MAKE_IOCTL(2)

/* Description : FW download complete */
/* input  : none */
/* output : none */
#define SIANO_BD_IOCTL_FW_DNL_COMPLETE      			SIANO_MAKE_IOCTL(3)

#endif
